import QtQuick 2.0
import QtQuick.Layouts 1.3
import Quick.UIComponent.SplitLine  0.1
import QtGraphicalEffects 1.0



Item{
    id:root
    property alias myModel:view.model
    property alias titleList:title.list
    property alias childComponet:view.delegate

    property var length:[]
    property var sortReg:[]


    Rectangle{
        anchors.fill: parent
        color: "transparent"
    }


    onMyModelChanged: {
        view.model = myModel
    }


    ColumnLayout{
        anchors.fill: parent
        RowDeletege {
            id:title
            Layout.fillWidth: true
            Layout.preferredHeight: 60
        }
        ListView{
            id:view
            clip: true
            Layout.fillWidth: true
            Layout.fillHeight:  true
            delegate:dataDelete

            Component{
                id:dataDelete
                DataRowDeletege{
                    width: 1700
                    height: 50
                    length:root.length
                    list: getList(view.model.get(index))

                }
            }
        }
    }


    function getList(jsonObj){
        var list = []
        for(var k in jsonObj){
            for(var key = 0 ; key< sortReg.length;key++){
                if(sortReg[key] === k ){
                    list[key] = jsonObj[k]
                }
            }
        }
        return list
    }





}
